home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14501 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: nntp.hut.fi!usenet
  2. From: hakola@cc.hut.fi (Petri Hakola)
  3. Newsgroups: comp.lang.c
  4. Subject: Set-merging algorithm?
  5. Date: 15 Apr 1996 15:35:46 +0300
  6. Organization: Capten Napalm`s Thermonuclear League of Liberty
  7. Sender: hakola@gamma.hut.fi
  8. Distribution: inet
  9. Message-ID: <m1a91fx7jh9.fsf@gamma.hut.fi>
  10. Reply-To: Petri.Hakola@hut.fi
  11. NNTP-Posting-Host: gamma.hut.fi
  12. X-Newsreader: Gnus v5.1
  13.  
  14.  
  15.             'allo,
  16.  
  17.     Is there any sophisticated algorithm for merging and building
  18.     combinations from sets.
  19.  
  20.     Like this:
  21.     I have {a, b, c} + {d e} + {f} and I need to form all possible
  22.     combinations. The amount of combs. is (of course) 3*2*1 = 6,
  23.     and the groups are as follows:
  24.  
  25.     {a d f} + {a e f} + {b d f} + {b e f} + {c d f} + {c e f}
  26.  
  27.     (i.e. only one member per set is 'allowed' in one group
  28.     (superset?))
  29.  
  30.     If there are more than a couple of sets, the amount of time
  31.     required to build all combinations is quite long, so I'd like
  32.     to know is there a better way to build these than
  33.     BruteForce. 
  34.  
  35.     Any help greatly appreciated
  36.  
  37.                         - Petri -
  38.